#!/usr/bin/env python
# -*- coding:utf8 -*-
"""
Author : mafei
@Date   : 2020/01/29

"""
import time
import math


def change_time(all_time):
    all_time = all_time / 1000
    day = 24 * 60 * 60
    hour = 60 * 60
    min = 60
    if all_time < 60:
        return "%d 秒" % math.ceil(all_time)
    elif all_time > day:
        days = divmod(all_time, day)
        return "%d 天, %s" % (int(days[0]), change_time(days[1]))
    elif all_time > hour:
        hours = divmod(all_time, hour)
        return '%d 小时, %s' % (int(hours[0]), change_time(hours[1]))
    else:
        mins = divmod(all_time, min)
        return "%d 分钟, %d 秒" % (int(mins[0]), math.ceil(mins[1]))


if __name__ == "__main__":
    print change_time(100000)
